<include file="Public/header" />
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>积分商城</h3>
      <ul class="tab-base">
        <li><a href="javascript:void(0);" class="current"><span>礼品管理</span></a></li>
        <li><a href="{:U('Gift/gift_add')}" class=""><span>新增礼品</span></a></li>
        <li><a href="{:U('Gift/gift_order')}" class=""><span>订单管理</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" name="formSearch">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th>礼品名称</th>
          <td><input type="text" value="{$search['sg_name']}" name="sg_name" class="txt" ></td>
          <td><a href="javascript:document.formSearch.submit();" class="btn-search tooltip" title="查询">&nbsp;</a></td>
        </tr>
      </tbody>
    </table>
  </form>
  <!-- 操作说明 -->
  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12" class="nobg">
        <div class="title">
        <h5>操作提示</h5>
        <span class="arrow"></span>
        </div>
        </th>
      </tr>
      <tr>
        <td>
        	<ul>
            	<li>可以在这里管理已添加的积分商城礼品信息，可对礼品进行删除操作</li>
          	</ul>
        </td>
      </tr>
    </tbody>
  </table>
  <form id="list_form" method='post'>
    <table class="table tb-type2">
      <thead>
        <tr class="space">
          <th colspan="15" class="nobg">列表</th>
        </tr>
        <tr class="thead">
          <th class="w48"></th>
          <th class="w300">礼品名称</th>
          <th>礼品编号</th>
		  <th>积分数</th>
		  <th>库存数量</th>
		  <th>上架状态</th>
		  <th>推荐状态</th>
		  <th>添加时间</th>
		  <th>最后修改时间</th>
          <th class="w84 align-center">操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="val">
        <tr class="hover edit">
          <td><input type="checkbox" name="del_id[]" value="{$val['sg_id']}" class="checkitem"></td>
          <td><a href="#" target="_blank">{$val['sg_name']}</a></td>
		  <td>{$val['sg_code']}</td>
		  <td>{$val['sg_point']}</td>
		  <td>{$val['sg_num']}</td>
		  <td>{$val['sg_sale']==1?'上架':'下架'}</td>
		  <td>{$val['sg_recommend']==1?'是':'否'}</td>
		  <td>{$val['sg_add_time']|date='Y-m-d H:i:s',###}</td>
		  <td>{$val['sg_last_change_time']|date='Y-m-d H:i:s',###}</td>
		  <td class='align-center'>
		  	<a href="{:U('Gift/gift_edit',array('sg_id'=>$val['sg_id']))}">编辑</a>
		  </td>
        </tr>
        </volist>
        <else /> 
        <tr class="no_data">
          <td colspan="10">暂无记录</td>
        </tr>
        </notempty>
      </tbody>
      <notempty name="list">
      <tfoot>
        <tr class="tfoot">
          <td><input type="checkbox" class="checkall" id="checkall_1"></td>
          <td id="batchAction" colspan="15">
          	<span class="all_checkbox">
            	<label for="checkall_1">全选</label>
            	<a href="javascript:void(0)" class="btn" onclick="submit_delete_batch();"><span>删除</span></a>
            </span>
            <div class="pagination">{$show_page}</div>
        </tr>
      </tfoot>
      </notempty>
    </table>
  </form>
</div>
<script type="text/javascript">
function submit_delete_batch()
{
	$('#list_form').submit();
}
</script>
<include file="Public/footer" />